/*
 * @Author       : Wuhexing
 * @Date         : 2021-12-08 21:35:05
 * @LastEditTime : 2021-12-11 22:42:04
 * @Description  : file content
 * @FilePath     : \USERd:\Git-code\stm32\My_OS\v0.2 - 副本\Hex_OS\os_param.h
 */
#ifndef OS_PARAM_H
#define OS_PARAM_H

#define OS_HEARTBEAT                100 // f = OSHEARTBEAT
#define OS_MAINSTACK_SIZE           128

#ifndef NULL
	#define NULL ((void *)0)
#endif

/**
 * @description: 获取TYPE类型结构体中MEMBER成员的地址偏移量
 */
#define offset_of(TYPE, MEMBER) ((size_t) & ((TYPE *)0)->MEMBER)

/**
 * @description: 根据MEMBER成员的地址,获取TYPE类型结构体的首地址指针
 */
#define container_of(MADDR, TYPE, MEMBER) ((TYPE *)((char *)MADDR - offset_of(TYPE, MEMBER)))

#endif
